<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="/struts-tags" prefix="s"%>

<html>

<head>
	<title>OSN Platform Web</title>
	<meta http-equiv="Content-Type" content="text/html; UTF-8">
	<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
	<s:head />
	
 
<script type="text/javascript">


  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-18322085-34']);
  _gaq.push(['_trackPageview']);


  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();


</script>
	
</head>

<body>
	<div id="container">

		<div id="header">
			<a href="http://opencities.upf.edu"><img src="images/logo.png"></a>
			<s:if test="#session.user == null">
				<h1>User Register</h1>
			</s:if>
			<s:else>
				<h1>Edit Profile</h1>
			</s:else>
		</div>

		<s:include value="menu.jsp" />


		<div id="content">
			<s:include value="leftmenu.jsp" />
			<div id="asideright" align="center">face
				<s:if test="#session.user == null">
					<h2>Fill the form</h2>
					<div id="stylized" class="userRegisterForm">
						<s:form id="form" action="newUser">
							<s:hidden name="isSignUp" value="true" />
							<s:hidden name="isLogin" value="false" />
							<s:textfield name="user.email" label="Email" />
							<s:textfield name="confirmEmail" label="Confirm email" />
							<s:password name="user.password" label="Password" />
							<s:password name="confirmPassword" label="Confirm password" />
							<s:textfield name="user.name" label="First Name" />
							<s:textfield name="user.lastName" label="Last Name" />
							<s:textfield name="user.company" label="Company" />
							<s:textfield name="user.country" label="Country" />
							<s:submit type="button" value="Submit" />
						</s:form>
					</div>
				</s:if>
				
				<s:else>
					<h2>Edit profile</h2>
					<div id="stylized" class="userRegisterForm">
						<s:form action="updateProfile">
							<s:hidden name="isProfileUpdate" value="true" />
							<s:hidden name="isSignUp" value="false" />
							<s:hidden name="isLogin" value="false" />
							<s:textfield name="user.email" label="Email"
								value="%{user.email}" readonly="true" />
							<s:textfield name="user.name" label="First Name"
								value='%{user.name}' />
							<s:textfield name="user.lastName" label="Last Name"
								value='%{user.lastName}' />
							<s:textfield name="user.company" label="Company"
								value='%{user.company}' />
							<s:textfield name="user.country" label="Country"
								value='%{user.country}' />
							<s:submit type="button" value="Update"
								onclick="alert('Profile updated!')" />
						</s:form>
					</div>
				</s:else>
			</div>
			<div id="bottom"></div>
		</div>
		<s:include value="footer.jsp" />
	</div>
</body>
</html>
